<?php

use Aug\Tools\Helper;

include __DIR__ . '/../vendor/autoload.php';
ini_set("memory_limit", "1024M");
$uniqueIds = [];
$count = 1000000;
$t1 = microtime(true);
for($i=0; $i<$count; $i++) {
    $randomId = Helper::getUniqueId();
    $uniqueIds[$randomId] = $randomId;
}

$wasteTime = bcsub(microtime(true), $t1, 4);
var_dump(sprintf("共耗时%s秒，生成%s条记录，重复记录数%s条", $wasteTime, $count, $count - count($uniqueIds)));